package index.Btree;

public interface BtreeInterface {
	
	public final static int k_n = 3;//�ڵ�Ԫ�ظ��� 
	public final static String index_file_addr = "./source/test.id" ;
	public final static int block_size = 1024 *3 ;   //ÿ��ҳ���ڵ㣩�Ĵ�С
	public final static int block_head_size = 1024 ; //index�ļ�ͷ����С
	public final static int block_head_bmp = 5000 ; //index �ڵ�ռ�� λ��ͼ(���5000ҳ),��־�Ƿ�ʹ��
	
	//////<------------indexͷ������---------------------
	public final static int index_head_en = 4 ;//ÿ��ҳ�����Ԫ����ռ���ֽڴ�С
	public final static int index_head_eb = 4 ;//���п���ռ���ֽڴ�С
	public final static int index_head_verson = 8 ; //�汾ռ���ֽڴ�С
	public final static int index_head_rn = 4 ;//rootҳ��ռ���ֽڴ�С
	public final static int index_head_date = 4;//����ռ�õ��ֽڴ�С
	public final static int index_head_author = 100 ; //author�ֽ����100�ֽ�(String ���ͱ䳤)
	///////------------------------------------------->
	
	
	//////<------------indexͷ������---------------------
	public abstract int getRootNum();   //��ȡrootҳ��
	
	public abstract int getKn(); //��ȡ�ڵ�Ԫ�ظ���
		
	public abstract int getBlockEmpty();//��ȡ��ҳ����
		
	public abstract double getVerson();//��ȡ�汾��
	
	public abstract int getDate();//��ȡ����
	
	public abstract String getAuthor();//��ȡ������Ϣ
	
	
	public abstract void setRootNum(int i);//����rootҳ��
	
	public abstract void setKn(int i);//���ýڵ�Ԫ�ظ���  

	public abstract void setBlockEmpty(int i);//���ÿսڵ����
	
	public abstract void setVerson(double i);//���ð汾��
	
	public abstract void setDate(int i);//��������
	
	public abstract void setAuthor(String i);//��������
	
	public abstract void setBtree(int rn,int kn,int bl,double v,int date,String author);//ͳһ����һ���ڵ����
	///////------------------------------------------->
	
	
	//////<------------�ڵ�ռ��λͼ����---------------------
	public abstract int getEmptyNode();  //��ȡһ����ҳ��ҳ��
	
	public abstract void setEmptyNode(int i); //���õ�iλΪ�սڵ㣨��iҳ��
	
	public abstract void setEmptyNode(int tag,int i);
	///////------------------------------------------->
	
	
	//////<------------index������������룬���ң�ɾ��---------------------	
	public abstract int addNode(); //����һ���ڵ㣬����ҳ��
	
	public abstract int splitNode(int blockID);//�ڵ���ѣ����ط��Ѻ������ڵ������root��ҳ��
	
	public abstract int splitNode2(int blockID,int blockID2);//�ڵ���ѣ����ط��Ѻ������ڵ������root��ҳ��
	
	public abstract int splitNodeInter(int blockID,int n,int LblockID,int RblockID);
	
	public abstract int combieNode(int blockID1,int blockID2);//�ϲ������ڵ㣬��������root��ҳ��
	
	public abstract void insertNode(int blockID,int i); //�ڽڵ�blockID�в����ֵ
	
	public abstract void insert(int i);  ///�����������
	
	public abstract boolean delete(int i); //ɾ���ֵ
		
	public abstract int searchNode(int blockID,int key); //��һ���ڵ�����Ҽ�ֵ������0���򲻴�
	
	public abstract int search(int blockID,int key);//���Ҽ�ֵ���ڵ�Ҷ�ӽڵ�(���ܴ治����)
	
	public abstract boolean movekey(int blockID,int i);//��ҳblockID��ɾ���i��key
	
	public abstract boolean delete(int blockID,int i);//ɾ���ҳ����е�i��key
	
	public abstract int[] movekey(int[]key,int index);//ɾ������Key�еĵ�index��ֵ�����鳤�ȼ�1
	
	public abstract int[] moveinsert(int[]key,int index,int i,int flag);//�˴�key�ĵ�index��ֵ��������i,falg=0����key�ף�1β
	
	public int findinfather(int []key,int i);//�ڸ��ڵ�����С��i�����ֵ
	
	public abstract int[] join(int[]before,int[]after);//��after����before�ĺ��
	
	public abstract boolean combieNode(int existid,int deleteid,int i,int flag);//��deleteid�ϲ���existid��㣬deleteid�еĵ�i��Ԫ�ر�ɾ��
	//flag���existid��ǰһ����㻹�Ǻ�һ����㣬0Ϊǰһ����1Ϊ��һ��
	/////---------------------------------------------->
	

}
